<?php

namespace Xin\Robot\ThinkPHP;

use think\Service;
use Xin\Robot\Contracts\Factory as RobotFactory;
use Xin\Robot\RobotManager;

class RobotServiceProvider extends Service
{

	/**
	 * @inheritDoc
	 */
	public function register()
	{
		$this->app->bind([
			'robot' => RobotFactory::class,
			RobotFactory::class => RobotManager::class,
			RobotManager::class => function () {
				$manager = new RobotManager(
					$this->app->config->get('robot')
				);
				$manager->setContainer($this->app);

				return $manager;
			},
		]);
	}
}
